var t = require("../../@babel/runtime/helpers/typeof");

(global.webpackJsonp = global.webpackJsonp || []).push([ [ "shop/address/addressList" ], {
    "019e": function(t, e, n) {
        n.r(e);
        var r = n("3fc2"), o = n.n(r);
        for (var i in r) "default" !== i && function(t) {
            n.d(e, t, function() {
                return r[t];
            });
        }(i);
        e.default = o.a;
    },
    "3fc2": function(e, n, r) {
        (function(e) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var o = r("7960"), i = r("8f9b"), a = r("8434"), c = (r("b806"), function(e) {
                if (e && e.__esModule) return e;
                if (null === e || "object" !== t(e) && "function" != typeof e) return {
                    default: e
                };
                var n = u();
                if (n && n.has(e)) return n.get(e);
                var r = {}, o = Object.defineProperty && Object.getOwnPropertyDescriptor;
                for (var i in e) if (Object.prototype.hasOwnProperty.call(e, i)) {
                    var a = o ? Object.getOwnPropertyDescriptor(e, i) : null;
                    a && (a.get || a.set) ? Object.defineProperty(r, i, a) : r[i] = e[i];
                }
                return r.default = e, n && n.set(e, r), r;
            }(r("03b8")));
            function u() {
                if ("function" != typeof WeakMap) return null;
                var t = new WeakMap();
                return u = function() {
                    return t;
                }, t;
            }
            function s(t) {
                return function(t) {
                    if (Array.isArray(t)) return f(t);
                }(t) || function(t) {
                    if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) return Array.from(t);
                }(t) || function(t, e) {
                    if (t) {
                        if ("string" == typeof t) return f(t, e);
                        var n = Object.prototype.toString.call(t).slice(8, -1);
                        return "Object" === n && t.constructor && (n = t.constructor.name), "Map" === n || "Set" === n ? Array.from(t) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? f(t, e) : void 0;
                    }
                }(t) || function() {
                    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
                }();
            }
            function f(t, e) {
                (null == e || e > t.length) && (e = t.length);
                for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
                return r;
            }
            function d(t, e) {
                var n = Object.keys(t);
                if (Object.getOwnPropertySymbols) {
                    var r = Object.getOwnPropertySymbols(t);
                    e && (r = r.filter(function(e) {
                        return Object.getOwnPropertyDescriptor(t, e).enumerable;
                    })), n.push.apply(n, r);
                }
                return n;
            }
            function l(t, e, n) {
                return e in t ? Object.defineProperty(t, e, {
                    value: n,
                    enumerable: !0,
                    configurable: !0,
                    writable: !0
                }) : t[e] = n, t;
            }
            var p = {
                data: function() {
                    return {
                        loadingOk: !0,
                        isRequest: !1,
                        bgs: !1,
                        list: [],
                        pagesize: 10,
                        page: 1,
                        isShow: !1,
                        type: "",
                        types: "",
                        good_type: ""
                    };
                },
                computed: function(t) {
                    for (var e = 1; e < arguments.length; e++) {
                        var n = null != arguments[e] ? arguments[e] : {};
                        e % 2 ? d(Object(n), !0).forEach(function(e) {
                            l(t, e, n[e]);
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : d(Object(n)).forEach(function(e) {
                            Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e));
                        });
                    }
                    return t;
                }({}, (0, (r("a71e"), r("db8f"), r("26cb")).mapGetters)([ "mainColor", "user", "iphoneXStyle" ])),
                created: function() {},
                onLoad: function(t) {
                    this.type = t.type, this.good_type = t.good_type, this.types = t.types;
                },
                onShow: function() {
                    this.getList();
                },
                methods: {
                    chooseAddress: function(t) {
                        if (3 != this.type) return !1;
                        this.type, e.setStorage({
                            key: "address" + c.uniacid,
                            data: JSON.stringify(t),
                            success: function() {
                                e.navigateBack();
                            }
                        });
                    },
                    remind: function(t) {
                        var e = this;
                        if (1 == t.is_default) return !1;
                        var n = {
                            id: t.id
                        };
                        (0, i.defaultAddress)(n).then(function(t) {
                            e.page = 1, e.list = [], e.getList();
                        });
                    },
                    getList: function() {
                        var t = this;
                        t.loadingOk = !1, t.isRequest = !1;
                        var n = {
                            page: t.page,
                            pagesize: t.pagesize
                        };
                        (0, i.addressList)(n).then(function(n) {
                            var r = t.list, o = n.list;
                            r && 1 != t.page && (o = [].concat(s(r), s(o))), t.list = o, t.loadingOk = !0, t.isRequest = 0 == t.list.length, 
                            t.isShow = !0, e.stopPullDownRefresh();
                        });
                    },
                    add: function(t, e) {
                        (0, o.h5JudgeLogin)(2).then(function(n) {
                            (0, a.route)({
                                url: "/shop/address/editAddress",
                                data: {
                                    id: e.id,
                                    type: t
                                }
                            });
                        });
                    },
                    del: function(t) {
                        var n = this;
                        e.showModal({
                            confirmText: "确认",
                            cancelText: "取消",
                            showCancel: !0,
                            title: "温馨提示",
                            content: "请确认是否删除",
                            success: function(e) {
                                if (e.confirm) {
                                    var r = {
                                        id: t.id
                                    };
                                    (0, i.delAddress)(r).then(function(t) {
                                        n.$toast("删除成功", "none"), n.page = 1, n.list = [], n.getList();
                                    });
                                }
                            }
                        });
                    },
                    onPullDownRefresh: function() {
                        this.page = 1, this.list = [], this.getList();
                    },
                    onReachBottom: function() {
                        this.page++, this.getList();
                    }
                }
            };
            n.default = p;
        }).call(this, r("543d").default);
    },
    "4a3b": function(t, e, n) {
        var r = n("9e6d");
        n.n(r).a;
    },
    5974: function(t, e, n) {
        n.d(e, "b", function() {
            return r;
        }), n.d(e, "c", function() {
            return o;
        }), n.d(e, "a", function() {});
        var r = function() {
            this.$createElement;
            this._self._c;
        }, o = [];
    },
    "9e6d": function(t, e, n) {},
    c7b1: function(t, e, n) {
        (function(t) {
            n("1067"), r(n("66fd"));
            var e = r(n("ec6d"));
            function r(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = n, t(e.default);
        }).call(this, n("543d").createPage);
    },
    ec6d: function(t, e, n) {
        n.r(e);
        var r = n("5974"), o = n("019e");
        for (var i in o) "default" !== i && function(t) {
            n.d(e, t, function() {
                return o[t];
            });
        }(i);
        n("4a3b");
        var a = n("f0c5"), c = Object(a.a)(o.default, r.b, r.c, !1, null, "69659160", null, !1, r.a, void 0);
        e.default = c.exports;
    }
}, [ [ "c7b1", "common/runtime", "common/vendor" ] ] ]);